<?php
//操作数据库，自己写入

$gamename = $_GET['uname'];
$gamesign = $_GET['sign'];

$gamekey='#)(@((EDLL@PP330@LD@:<VDKSS@_#(((#D(833NN';

date_default_timezone_set("Asia/Shanghai");

$nowtime= date("Y-m-d H:i:s");
//计算出新的token  由于是本地测试，服务器上不验证token，所以gamekey暂时不用计算。

$ticket  = "a9c7016b2b5d196942aeca9196135731";
//update mysql
//将账号update ocenter 中的 login_info
$con=mysqli_connect("192.168.2.208","root","123456","ocenter");
// 检测连接
if (mysqli_connect_errno())
{
    echo "连接失败: " . mysqli_connect_error();
}

$timenew = time();
$cqsql ='UPDATE login_info SET logintime=' .'"'.$nowtime .'"' ." , ticket =" . '"' .$ticket . '"' . " WHERE username =" . '"' .$gamename . '"';

//echo $cqsql ;
//exit;
mysqli_query($con,$cqsql);
mysqli_close($con);


//返回给客户端。

$data = array(
	"error_code"	=>	"1",
	"bill_no"	=>	time(),
	"username"  => "$gamename",
	"ticket"  => "$ticket"
);
echo json_encode($data);
?>